package team.xyg.cdtu2.controller;

import team.xyg.cdtu2.dto.Brand_sales_Map;
import team.xyg.cdtu2.dto.PlatMapData;
import team.xyg.cdtu2.entity.BrandSales;
import team.xyg.cdtu2.service.BrandSalesService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (BrandSales)表控制层
 *
 * @author makejava
 * @since 2022-06-28 08:54:29
 */
@RestController
@RequestMapping("brandSales")
public class BrandSalesController {
    /**
     * 服务对象
     */
    @Resource
    private BrandSalesService brandSalesService;




    @RequestMapping("map")
    public Map<String,Object> queryBrand_sales(){

        List<Brand_sales_Map> brand_sales_maps = brandSalesService.queryBrand_sales();

        Map<String, Object> result = new HashMap<>();
        result.put("code",200);
        result.put("message","success");
        result.put("data",brand_sales_maps);

        return result;

    }



    /**
     * 查询品牌销售Top5
     * @return
     */
   @GetMapping("brandTop")
    public Map<String,Object> queryBrandTop(){
       List<PlatMapData> map_data = brandSalesService.queryBrandTop();
       Map<String, Object> result = new HashMap<>();
       result.put("code",200);
       result.put("message","success");
       result.put("data",map_data);

       return result;
   }


}

